package jmc.core.model;

// Generated 17/10/2011 19:03:23 by Hibernate Tools 3.2.0.b9

import java.sql.Timestamp;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;

import org.hibernate.annotations.Immutable;

import jmc.util.DateUtil;

/**
 * Wd041803 generated by hbm2java
 */
@Entity
@Table(name = "WD013103")
@Immutable
public class Wd013103 implements java.io.Serializable {

	private Wd013103Id id;
	private String wxmoto;
	private String wxequi;
	private String wxfhpr;
	private String wxfhen;
	private char wxoren;
	private String wxraso;
	private byte wxzona;
	private byte wxsubz;
	private short wxmode;
	private String wxdemo;
	private String wxcate;
	private Integer wxnror;
	private String wxplor;
	private char wxcssf;
	private byte wxoper;
	private Short wxclie;	
	private String wjrndm;	
	private String wjvin;	
	private String wxfhes;
	private String wxesta;
	private byte wxdias;
	
	@Column(name = "WXDIAS", nullable = false, precision = 4, scale = 0)
	public byte getWxdias() {
		return wxdias;
	}












	public void setWxdias(byte wxdias) {
		this.wxdias = wxdias;
	}

	
	
	
	@Column(name = "WXFHES", nullable = false, length = 12)
	public String getWxfhes() {
		return this.wxfhes;
	}



	


	

















	public void setWxfhes(String wxfhes) {
		this.wxfhes = wxfhes;
	}

	@Column(name = "WXESTA", nullable = false, length = 1)
	public String getWxesta() {
		return wxesta;
	}


	public void setWxesta(String wxesta) {
		this.wxesta = wxesta;
	}


	@Column(name = "WJVIN", nullable = false, length = 17)
	public String getWjvin() {
		return this.wjvin;
	}

	public void setWjvin(String wjvin) {
		this.wjvin = wjvin;
	}





	@Column(name = "WJRNDM", nullable = false, length = 5)
	public String getWjrndm() {
		return this.wjrndm;
	}

	public void setWjrndm(String wjrndm) {
		this.wjrndm = wjrndm;
	}


	
	@Column(name = "WXMOTO", nullable = false, length = 13)
	public String getWxmoto() {
		return this.wxmoto;
	}

	public void setWxmoto(String wxmoto) {
		this.wxmoto = wxmoto;
	}


	public Wd013103() {
	}

	public Wd013103(Wd013103Id id) {
		this.id = id;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "wxvin", column = @Column(name = "WXVIN", nullable = false, length = 17)),
			@AttributeOverride(name = "wxviaj", column = @Column(name = "WXVIAJ", nullable = false, length = 12)),
			@AttributeOverride(name = "wxnrde", column = @Column(name = "WXNRDE", nullable = false, length = 6)),
			@AttributeOverride(name = "wxrndm", column = @Column(name = "WXRNDM", nullable = false, length = 5)) })

			public Wd013103Id getId() {
		return this.id;
	}

	public void setId(Wd013103Id id) {
		this.id = id;
	}

	@Column(name = "WXEQUI", nullable = false, length = 8)
	public String getWxequi() {
		return this.wxequi;
	}

	public void setWxequi(String wxequi) {
		this.wxequi = wxequi;
	}

	@Column(name = "WXFHPR", nullable = false, length = 12)
	public String getWxfhpr() {
		return this.wxfhpr;
	}

	public void setWxfhpr(String wxfhpr) {
		this.wxfhpr = wxfhpr;
	}

	@Column(name = "WXFHEN", nullable = false, length = 12)
	public String getWxfhen() {
		Long dias = 0l;
		try{
			dias = Long.parseLong(wxfhen);
			wxfhen = String.valueOf(dias);
		}catch(NumberFormatException ne){
			wxfhen = "";
		}
		return this.wxfhen;
	}

	public void setWxfhen(String wxfhen) {
		this.wxfhen = wxfhen;
	}

	@Column(name = "WXOREN", nullable = false, length = 1)
	public char getWxoren() {
		return this.wxoren;
	}

	public void setWxoren(char wxoren) {
		this.wxoren = wxoren;
	}

	@Column(name = "WXRASO", nullable = false, length = 30)
	public String getWxraso() {
		return this.wxraso;
	}

	public void setWxraso(String wxraso) {
		this.wxraso = wxraso;
	}

	@Column(name = "WXZONA", nullable = false, precision = 2, scale = 0)
	public byte getWxzona() {
		return this.wxzona;
	}

	public void setWxzona(byte wxzona) {
		this.wxzona = wxzona;
	}

	@Column(name = "WXSUBZ", nullable = false, precision = 2, scale = 0)
	public byte getWxsubz() {
		return this.wxsubz;
	}

	public void setWxsubz(byte wxsubz) {
		this.wxsubz = wxsubz;
	}

	@Column(name = "WXMODE", nullable = false, precision = 4, scale = 0)
	public short getWxmode() {
		return this.wxmode;
	}

	public void setWxmode(short wxmode) {
		this.wxmode = wxmode;
	}

	@Column(name = "WXDEMO", nullable = false, length = 20)
	public String getWxdemo() {
		return this.wxdemo;
	}

	public void setWxdemo(String wxdemo) {
		this.wxdemo = wxdemo;
	}

	@Column(name = "WXCATE", nullable = false, length = 3)
	public String getWxcate() {
		return this.wxcate;
	}

	public void setWxcate(String wxcate) {
		this.wxcate = wxcate;
	}

	
	
	@Column(name = "WXNROR", nullable = false, precision = 6, scale = 0)
	public int getWxnror() {
		return this.wxnror;
	}

	public void setWxnror(int wxnror) {
		this.wxnror = wxnror;
	}

	@Column(name = "WXPLOR", nullable = false, length = 8)
	public String getWxplor() {
		return this.wxplor;
	}

	public void setWxplor(String wxplor) {
		this.wxplor = wxplor;
	}

	@Column(name = "WXCSSF", nullable = false, length = 1)
	public char getWxcssf() {
		return this.wxcssf;
	}

	public void setWxcssf(char wxcssf) {
		this.wxcssf = wxcssf;
	}

	@Column(name = "WXOPER", nullable = false, precision = 2, scale = 0)
	public byte getWxoper() {
		return this.wxoper;
	}

	public void setWxoper(byte wxoper) {
		this.wxoper = wxoper;
	}

	@Column(name = "WXCLIE", nullable = false, precision = 3, scale = 0)
	public short getWxclie() {
		return this.wxclie;
	}

	public void setWxclie(short wxclie) {
		this.wxclie = wxclie;
	}
	
	@Transient
	public String getFormatedWxesta() {
		if (this.getWxesta().trim().equals("1")){
			return "1-REMI";
		}
		if (this.getWxesta().trim().equals("2")){
			return "2-CARG";
		}
		if (this.getWxesta().trim().equals("3")){
			return "3-ENTR";
		}
		
		return "";
	}
	
	@Transient
	public String getFormatedWxfhes() {
		try{
			Timestamp tm = DateUtil.composeDateTimeAS(wxfhes);		
			return DateUtil.getFormatedDate(tm);
			
		}catch(Exception e){
			e.printStackTrace();
			return "";
		}
	}
	
	@Transient
	public String getFormatedWxfhen() {
		try{
			Timestamp tm = DateUtil.composeDateTimeAS(wxfhen);		
			return DateUtil.getFormatedDate(tm);
			
		}catch(Exception e){
			e.printStackTrace();
			return "";
		}
	}
	@Transient
	public String getFormatedWxfhpr() {
		try{
			Timestamp tm = DateUtil.composeDateTimeAS(wxfhpr);		
			return DateUtil.getFormatedDate(tm);
			
		}catch(Exception e){
			e.printStackTrace();
			return "";
		}
	}
	
	
	
	
	
	

}
